package com.qd.pay.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单管理
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("sys_order")
public class Order extends Model<Order> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "order_id", type = IdType.ASSIGN_ID)
    private String orderId;
    /**
     * 商户订单号
     */
    @TableField("out_trade_no")
    private String outTradeNo;
    /**
     * 第三方订单ID
     */
    @TableField("third_party_order")
    private String thirdPartyOrder;
    /**
     * 设备号
     */
    @TableField("device_info")
    private String deviceInfo;
    /**
     * 商品名称
     */
    @TableField("subject")
    private String subject;
    /**
     * 商品描述
     */
    @TableField("body")
    private String body;
    /**
     * 支付金额
     */
    @TableField("pay_amount")
    private BigDecimal payAmount;
    /**
     * 付款人
     */
    @TableField("personid")
    private String personid;
    /**
     * 终端IP
     */
    @TableField("ip_address")
    private String ipAddress;
    /**
     * 通知回执地址
     */
    @TableField("notify_url")
    private String notifyUrl;
    /**
     * 订单提交时间
     */
    @TableField("send_time")
    private LocalDateTime sendTime;
    /**
     * 订单修改时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;
    /**
     * AP编号
     */
    @TableField("apcode")
    private String apCode;
    /**
     * 订单类型:0微信1支付宝2天府银行
     */
    @TableField("type")
    private Integer type;
    /**
     * 订单状态:0正常1关闭
     */
    @TableField("state")
    private Integer state;
    /**
     * 平台订单号
     */
    @TableField("transaction_id")
    private String transactionId;

    public void freeData() {
        this.orderId = null;
        this.outTradeNo = null;
        this.thirdPartyOrder = null;
        this.deviceInfo = null;
        this.subject = null;
        this.body = null;
        this.payAmount = null;
        this.personid = null;
        this.ipAddress = null;
        this.notifyUrl = null;
        this.sendTime = null;
        this.updateTime = null;
        this.apCode = null;
        this.type = null;
        this.state = null;
        this.transactionId = null;
    }

}
